from TransRecipe import RecipeXml
from TransCarbon import TransCarbon
from TransDely   import TransDely

SMB_PATH_IN   = '\\\\10.221.173.151\\Avid\\in\\'
SMB_PATH_OUT  = '\\\\10.221.173.151\\Avid\\out'
GUID_43       = '{DB64C4B7-EB3E-4CBC-8B65-2C9BCA1B1A39}'
GUID_169      = '{5F3972E5-BFA3-49AD-8A5C-BF3FE8C98746}'
XML           = './PG-60822-2-HOGAREXPRESS2010-HE60-EPISODIO60-VDPM.mxf.xml'
MXF           = 'PG-60822-2-HOGAREXPRESS2010-HE60-EPISODIO60-VDPM.mxf'
MEDIA_PATH    = '/data/Avid/in/'



x = open("JobSegment.xml")
xml = x.read()
recipe = RecipeXml(xml)

car = TransCarbon("10.221.173.31", SMB_PATH_IN, SMB_PATH_OUT, MEDIA_PATH, '/data/Avid/out/')


print recipe.Destination[0].transcoder.Guid
print recipe.Destination[0].transcoder.Ext
print recipe.Destination[0].transcoder.Segments[0].In
print recipe.Destination[0].transcoder.Segments[0].Out


car.Start(MXF, recipe.Destination[0].transcoder)

L = car.WaitFinish() 

dely = TransDely('/data/Avid/out/')
dely.Send(L, recipe.Destination[0].Dely[0])

